home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 4 / Amoszine 4 (Disk 1 of 3).adf / READERS_SOURCE.LHA / READERS_SOURCE / PRO_S.PULLINGER / Text_Requester.Amos / Text_Requester.amosSourceCode
Encoding:
AMOS Source Code  |  1992-02-26  |  1.7 KB  |  64 lines

  1. ' Text_Requester.Amos - Steve Pullinger  
  2.  
  3.  
  4. ' Uses Interface to get an input string from the user
  5.  
  6.  
  7. ' Initialise Interface resources 
  8. Load "AMOSPro_Tutorial:Tutorials/Interface/Example_resource.abk"
  9. Resource Bank 16
  10. Resource Screen Open 0,640,200,0
  11. Flash Off : Curs Off : Cls 0 : Paper 0 : Pen 8
  12. Palette ,,,,$840,$C84,$FC8,$FEB
  13. Wait Vbl 
  14.  
  15.  
  16. ' Example procedure call 
  17. T_REQUEST["This is a Test Title"]
  18. TR$=Param$ : Rem Get return value 
  19.  
  20. ' Print String from basic
  21. Print "Procedure returned: ";TR$
  22.  
  23. Procedure T_REQUEST[TITLE$]
  24.    
  25.    ' This procedure displays an Interface requester centred on-screen 
  26.    ' The title for the requester is passed as TITLE$ and the procedure
  27.    ' returns the text input from an Interface EDit zone 
  28.    
  29.    ' EXAMPLE: REQUEST["Please enter some text"] 
  30.    
  31.    ' Interface Program
  32.    
  33.    IN_STRING$=IN_STRING$+"BAse     80,40;"
  34.    IN_STRING$=IN_STRING$+"SIze     1VATextWidth32+,TextHeight6*;"
  35.    IN_STRING$=IN_STRING$+"BAse     ScreenWidth SizeX-2/,ScreenHeight SizeY-2/;"
  36.    IN_STRING$=IN_STRING$+"SAve     1;"
  37.    IN_STRING$=IN_STRING$+"BOx      0,0,1,SizeX,SizeY;"
  38.    IN_STRING$=IN_STRING$+"POutline 1VACentreX,10,1VA,0,3;"
  39.    IN_STRING$=IN_STRING$+"ED       1,16,32,2VA,30,'',4,6 ;"
  40.    IN_STRING$=IN_STRING$+"EXit;"
  41.    
  42.    
  43.    ' Open Communication Channel between Amos and Interface program
  44.    Dialog Open 1,IN_STRING$
  45.    
  46.    ' Pass title string to Interface 
  47.    TITLE$=" "+TITLE$
  48.    TITLE$=TITLE$+" "
  49.    Vdialog$(1,1)=TITLE$
  50.    Vdialog(1,2)=Len(TITLE$)
  51.    
  52.    ' Call GET_STRING$ program 
  53.    X=Dialog Run(1)
  54.    
  55.    ' Wait for input complete
  56.    Repeat 
  57.       ' RET$ is returned by the procedure to Amos
  58.       RET$=Rdialog$(1,1)
  59.    Until Dialog(1)
  60.    
  61.    ' Close Interface program
  62.    Dialog Close(1)
  63.    
  64. End Proc[RET$]